QT       += core gui

TEMPLATE = app
TARGET = App

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++17

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0


# 引入 staticLib UIlib
INCLUDEPATH += ../UIlib
win32:LIBS += -L$$PWD/../plugins -lUIlib
unix:LIBS += -L$$PWD/../plugins -lUIlib

#引入pluginB plugin
INCLUDEPATH += ../pluginB
win32:LIBS += -L$$PWD/../plugins/pluginB -lpluginB
unix:LIBS += -L$$PWD/../plugins/pluginB -lpluginB

#引入shareA share
INCLUDEPATH += ../shareA
win32:LIBS += -L$$PWD/../plugins/shareA -lshareA1
unix:LIBS += -L$$PWD/../plugins/shareA -lshareA1


#引入CoreLib  staticlib
# 根据构建类型选择
CONFIG(debug, debug|release) {
    message("我是CoreLib debug");
    # 调试版本使用 .pri，方便调试
    #include($$PWD/../CoreLib/CoreLib.pri)
} else {
    # 发布版本使用 StaticLib，优化编译速度
     message("我是CoreLib release");
    #INCLUDEPATH += ../CoreLib
    #win32:LIBS += -L$$PWD/../plugins/CoreLib -lCoreLib
    #unix:LIBS += -L$$PWD/../plugins/CoreLib -lCoreLib
}
include(../CoreLib/CoreLib.pri)
message("INCLUDEPATH: $$INCLUDEPATH")

SOURCES += \
    main.cpp \
    mainwindow.cpp \
    pluginmanager.cpp

HEADERS += \
    mainwindow.h \
    pluginmanager.h

FORMS += \
    mainwindow.ui

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target


# 方法1：复制整个 plugins 目录
#D:/qtprojects/SolutionProject/build/Qt_6_9_1_mingw_64-Debug/App/debug/plugins
plugins.files = $$PWD/../plugins/* #项目目录上一级的 plugins/pluginA 下所有文件）
plugins.path = $$OUT_PWD/plugins #构建目录下的 wplugins 文件夹
COPIES += plugins

# 输出调试信息
message("Source plugins========: $$plugins.files")
message("Destination===========: $$plugins.path")
# 在 .pro 文件中添加调试信息
message("=== 路径调试信息 ===")
message("PWD: $$PWD")                              # 项目文件所在目录
message("DESTDIR: $$DESTDIR")                      # 目标目录
message("OUT_PWD: $$OUT_PWD")                      # 输出目录
message("_PRO_FILE_PWD_: $$_PRO_FILE_PWD_")        # 项目文件目录
message("_PRO_FILE_: $$_PRO_FILE_")                # 项目文件路径
message("======================================")
# 查看构建配置
message("构建配置:")
message("CONFIG: $$CONFIG")
message("TARGET: $$TARGET")
message("======================================")
